package com.yuxi.pubInter;


import com.yuxi.pubInter.baseVO.DecorateModel;
import com.yuxi.pubInter.baseVO.DecoratePageList;
import com.yuxi.pubInter.exception.SkException;

import java.util.List;
import java.util.Map;
import java.util.Set;

/**
 * @author sunke
 * @Date 2020-12-11 10:20:59
 * @description
 */

public interface IBaseFindService<T extends BaseIdDoMain<KeyType>, TS extends BaseSearch, KeyType> {



    /**
     * 查询统计
     * @param fieldSet
     * @param search
     * @return
     * @throws SkException
     */
    Map<String,Object> totalMap(Set<String> fieldSet, TS search) throws SkException;


    /**
     * 详情
     *
     * @param id pk
     * @return
     * @throws SkException
     */
    T getDetail(KeyType id) throws SkException;


    /**
     * 详情
     *
     * @param id            pk
     * @param fullConfigSet
     * @return
     * @throws SkException
     */
    T getDetail(KeyType id, Set<String> fullConfigSet) throws SkException;

    T getDetailByUnFullConfigSet(KeyType id, Set<String> unFullConfigSet) throws SkException;

    /**
     * @param id
     * @return
     * @throws SkException
     */
    DecorateModel<T> getDetailToObject(KeyType id) throws SkException;


    /**
     * @param id
     * @return
     * @throws SkException
     */
    DecorateModel<T> getDetailToObject(KeyType id, Set<String> fullConfigSet) throws SkException;

    DecorateModel<T> getDetailToObjectByUnFullConfigSet(KeyType id, Set<String> unFullConfigSet) throws SkException;

    /**
     * @param search
     * @return
     * @throws SkException
     */
    List<T> getList(TS search) throws SkException;

    /**
     * @param search
     * @return
     * @throws SkException
     */
    int getListCount(TS search) throws SkException;

    /**
     * @param search
     * @return
     * @throws SkException
     */
    List<T> getAllList(TS search) throws SkException;

    /**
     * @param search
     * @return
     * @throws SkException
     */
    Map<String, Object> paginate(TS search) throws SkException;

    DecoratePageList<T> paginateToObject(TS search) throws SkException;

    /**
     * @param search
     * @return
     */
    T getDetailBySearch(TS search);


    /**
     * @param search
     * @return
     */
    int getCountBySearch(TS search);


    /**
     * 根据IDs 得到所有
     *
     * @param ids
     * @param fullConfigSet
     * @return
     * @throws SkException
     */
    List<T> getAllByIds(List ids, Set<String> fullConfigSet) throws SkException;

    /**
     * 根据某一个字段In 查询
     *
     * @param inValue
     * @param field
     * @param fullConfigSet
     * @return
     * @throws SkException
     */
     List<T> getAllByInField(List inValue, String field, Set<String> fullConfigSet) throws SkException;


    /**
     * 得到列表
     * @param size
     * @return
     */
    List<T> getListBySize(int size);





    /**
     * 得到列表
     * @param size
     * @return
     */
    List<T> getListBySizeAndLang(int size,String lang);



    public void fullCn(T t);

    public void fullEn(T t) ;

    public void fullOther(T t) ;

     void fullByLang(T t, String lang);


}
